package www.guigu.com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import www.guigu.com.pojo.Houtai;
import www.guigu.com.service.impl.Queryallserviceimpl;

import javax.servlet.http.HttpServletRequest;

@Controller
public class SySRoleController {
    @Autowired
    Queryallserviceimpl service;
    @GetMapping("ss")
public String Login(String zh, String mm, HttpServletRequest request){
        Houtai hh=service.login(zh, mm);
        System.out.println(hh+"跟蹦");
        if(hh!=null){
            request.getSession().setAttribute("ss",hh);
            return "redirect:/hout";
        }
        return "login";
    }
    @RequestMapping("hout")
    public String houtai(HttpServletRequest request){
        Object hh=request.getSession().getAttribute("ss");
        System.out.println(hh+"急急急");
        if(hh!=null){
            return "houtai";
        }
        return "login";
    }
}
